From: Keir Fraser Date: Fri, 25 Jan 2008 13:42:36 +0000 (+0000) Subject: x86: Clarify early_page_fault() handler intent, and improve debug tracing. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14402 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=4eb25830f31788ac8d19514ec66bc28590b0b4ed;p=xen.git x86: Clarify early_page_fault() handler intent, and improve debug tracing. Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 479376faed..7ac4bb2c32 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -1119,12 +1119,11 @@ asmlinkage void do_page_fault(struct cpu_user_regs *regs) } /* - * Early handler to deal with spurious page faults. For example, consider a - * routine that uses a mapping immediately after installing it (making it - * present). The CPU may speculatively execute the memory access before - * executing the PTE write. The instruction will then be marked to cause a - * page fault when it is retired, despite the fact that the PTE is present and - * correct at that point in time. + * Early #PF handler to print CR2, error code, and stack. + * + * We also deal with spurious faults here, even though they should never happen + * during early boot (an issue was seen once, but was most likely a hardware + * problem). */ asmlinkage void do_early_page_fault(struct cpu_user_regs *regs) { @@ -1143,8 +1142,15 @@ asmlinkage void do_early_page_fault(struct cpu_user_regs *regs) } if ( stuck++ == 1000 ) - panic("Early fatal page fault at %04x:%p (cr2=%p, ec=%04x)\n", - regs->cs, _p(regs->eip), _p(cr2), regs->error_code); + { + unsigned long *stk = (unsigned long *)regs; + printk("Early fatal page fault at %04x:%p (cr2=%p, ec=%04x)\n", + regs->cs, _p(regs->eip), _p(cr2), regs->error_code); + printk("Stack dump: "); + while ( ((long)stk & ((PAGE_SIZE - 1) & ~(BYTES_PER_LONG - 1))) != 0 ) + printk("%p ", _p(*stk++)); + for ( ; ; ) ; + } } long do_fpu_taskswitch(int set)